package com.hongyuan.sellfitness.ui.home.view_mode;


import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.hongyuan.mvvmhabitx.binding.command.BindingAction;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.mvvmhabitx.bus.RxBus;
import com.hongyuan.sellfitness.base.ItemViewModel;
import com.hongyuan.sellfitness.ui.home.beans.CouponBean;

public class UseCouponItemViewModel extends ItemViewModel<UseCouponViewModel> {

    public ObservableField<CouponBean.ListBean> entity = new ObservableField<>();

    public UseCouponItemViewModel(@NonNull UseCouponViewModel viewModel , CouponBean.ListBean bean) {
        super(viewModel);
        this.entity.set(bean);
    }

    //条目的点击事件
    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            RxBus.getDefault().post(entity.get());
            viewModel.finish();
        }
    });
}
